﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;

namespace PreeRegisterBLL.Security
{
    public static class HashBase64
    {
        public static string myHashBase64(string str)
        {
            byte[] result = new byte[str.Length];
            try
            {
                SHA1 sha = new SHA1CryptoServiceProvider();
                result = sha.ComputeHash(System.Text.Encoding.UTF8.GetBytes(str));
                return Convert.ToBase64String(result);
            }
            catch
            {
                return "";
            }
        } 
    }
}
